<template>
  <div class="chart-container"></div>
</template>

<script>
export default {
  name: "demoTwenty2",
  filters: {},
  data() {
    return {};
  },
  created() {},
  mounted() {
   // this.restFm();
   // this.restTwo();
   this.foo(10, 20, 30);

  },
  methods: {
     foo() {
          console.log(arguments);
          for (var i=0; i<arguments.length; i++) {
              console.log(arguments[i]); // 10, 20, 30
          }

      },


    restFm() {
      let a = [1, 2, 3];
      let b = [0, ...a, 4]; // [0,1,2,3,4]
      let obj = { a: 1, b: 2 };
      let obj2 = { ...obj, c: 3 }; // { a:1, b:2, c:3 }
      let obj3 = { ...obj, a: 3 }; // { a:3, b:2 }
      console.log(b);
      console.log(obj2);
      console.log(obj3);
    },

    restTwo() {
      // let a = [1, 2, 3];
      // let [b, ...c] = a;
      // console.log(b);//1
      // console.log(c);//[2,3]
       

  
      // let a = [1, 2, 3];
      // let [b, ...[c, d, e]] = a;
      // console.log(b)//1
      // console.log(c)//2
      // console.log(d)//3
      // console.log(e)//undefined

    
      // function test(a, ...rest) {
      //   // rest为剩余参数
      //   console.log(a); // 1
      //   console.log(rest); // [2,3]
      // }
      // test(1, 2, 3);

       function testOne(...rest) {
        console.log(rest); // [2,3]
        console.log(Array.isArray(rest))
        rest.push(66)
        console.log(rest); // [2,3]

      }
      testOne(1, 2, 3);




    }


  }
};
</script>

<style >
/*
    定宽高 
    1.绝对定位和负magin值
    2.绝对定位 + transform
    3.flex布局

     不定宽高 
      1.绝对定位 + transform
      2.flex布局

*/
.chart-container {
  position: relative;
  width: 100%;
  height: calc(100vh - 84px);
}

/* .box {
    width: 200px;
    height: 200px;
    border: 1px solid red;
    position: relative;
}
.children-box {
    position: absolute;
    width: 100px;
    height: 100px;
    background: yellow;
    left: 50%;
    top: 50%;
    margin-left: -50px;
    margin-top: -50px; 
}
 */
</style>
